import {createSlice, PayloadAction} from "@reduxjs/toolkit";

export const countSlice = createSlice({
  name: 'count',
  initialState: {count: 1},
  reducers: {
    increment: (state) => {
      state.count++
    },
    set: (state, action: PayloadAction<number>) => {
      state.count = action.payload
    }
  }
})


export const {increment, set} = countSlice.actions
